package com.ww.springboot.dd.amazon;


import com.baomidou.mybatisplus.core.toolkit.StringPool;

import java.util.Arrays;
import java.util.List;

/**
 * @author wuxin
 * @version 1.0
 * @date 2021/9/17 14:17
 * @Description API
 */
public class AmazonApiConstant {


    /**
     * 创建报告 API
     */
    public final static String AMAZON_REQUEST_REPORT  = "mws/report/requestReport";
    /**
     * 获取报告状态 API
     */
    public final static String AMAZON_GET_REPORT_REQUEST_LIST  = "mws/report/getReportList";
    /**
     * 下载报告 API
     */
    public final static String AMAZON_GET_REPORT  = "mws/report/getReport";
    /**
     * 根据 ASIN、GCID、SellerSKU、UPC、EAN、ISBN 和 JAN，返回商品及其属性列表。 API
     */
    public final static String GET_MATCHING_PRODUCT_FOR_ID  = "product/getMatchingProductForId";
    /**
     * 根据 SellerSKU，返回商品所在的商品分类。 API
     */
    public final static String GET_PRODUCT_CATEGORIES_FOR_SKU  = "product/GetProductCategoriesForSKU";
    /**
     * 根据 SellerSKU，返回您自己的商品的价格信息。API
     */
    public final static String GET_MY_PRICE_FOR_SKU  = "product/getMyPriceForSKU";
    /**
     * 上传数据
     */
    public final static String SUBMIT_FEED  = "submit/submitFeed";
    /**
     * 获取上传数据处理状态
     */
    public final static String GET_FEED_SUBMISSION_LIST  = "submit/getFeedSubmissionList";
    /**
     * 获取上传数据处理结果
     */
    public final static String GET_FEED_SUBMISSION_RESULT  = "submit/getFeedSubmissionResult";


    /************************************* ap api *********************************************/
    /**
     * 根据您指定的搜索查询或项目标识符，返回项目及其属性的列表
     */
    public final static String LIST_CATALOG_ITEMS  = "catalog/listCatalogItems";
    public final static String GET_CATALOG_ITEM  = "catalog/getCatalogItem";
    /**
     * 获取 listing 类目
     */
    public final static String LIST_CATALOG_CATEGORIES  = "catalog/listCatalogCategories";
    /**
     * 上传数据
     */
    public final static String SP_SUBMIT_FEED  = "feed/submitFeed";
    /**
     * 获取上传数据处理状态
     */
    public final static String GET_FEED  = "feed/getFeed";
    /**
     * 获取上传数据处理结果
     */
    public final static String GET_FEED_DOCUMENT  = "feed/getFeedDocument";
    /**
     * 创建报告 API
     */
    public final static String SP_REQUEST_REPORT  = "report/requestReport";
    /**
     * 获取报告状态 API
     */
    public final static String SP_GET_REPORT_REQUEST_LIST  = "report/getReportList";
    /**
     * 下载报告 API
     */
    public final static String SP_GET_REPORT  = "report/getReport";

    public static List<String> RETRY_ERROR_MSGS = Arrays.asList("token","Connection reset","Connection timed out");

    /**
     * 根据 SellerSKU 获取 Listing 信息
     */
    public final static String GET_LISTINGS_ITEM  = "listing/getListingsItem";

    public static String getCommonUrl(String domain, String apiLocation) {
        StringBuffer url = new StringBuffer(domain);
        url.append(StringPool.SLASH);
        url.append(apiLocation);
        return url.toString();
    }
}
